Building an SNMP Agent for MacSNMP 1.1 requires the Apple Shared Library Manager version 1.1.2. For more detailed documentation on the Shared Library Manager 1.1.2, look on E.T.O CD ROM #12 or later. SNMP Agents built with previous versions of ASLM will not be supported. You should upgrade your SNMP libraries by recompiling and linking them with the new ASLM 1.1.2.
Upgrading an SNMP library for MacSNMP 1.1 and ASLM 1.1.2
The upgrade procedure is fairly straightforward. You can compare the sources of the SampleAgent 1.0.2 and 1.1 to have comprehensive idea of what to do. Here are the main steps:
1) Use the header files, libraries and tools found on the MacSNMP Developer disks version 1.1 instead of the old ones.
2) The BuildSharedLibrary commands now use option "-lib" instead of "-o" and needs the client object file needs to be in the list of libraries. You should update your makefile accordingly.
3) Append a version string to the ASLM class IDs of your agent and variables classes. For example the ASLM class ID of the class TSampleSNMPAgent is now: "snmp:agt$TSampleSNMPAgent,1.1" where the version information “,1.1” has been added.
This feature allows the Shared Library Manager to automatically load the more recent version of a class.
4) In the .exp files, be sure to use a unique library ID for each library. The Shared Library Manager version 1.1.2 now enforces this uniqueness.
5) If you need your SNMP agent to stay loaded in memory use the flags preload and stayLoaded.
5) In your .cp files, change the type of the integer used for the calls to Preflight and Postflight from short to long.
6) If you need one and only one instance of a class, register it with the global arbitrator using a string that identifies the class across versions. For example the SampleAgent version 1.1 uses the root of class ID string ""snmp:agt$TSampleSNMPAgent", without the version information, because the same string were used by the version 1.0 of the SampleAgent.
NOTA BENE
==========
The libraries and header files from the “ASLM Developer Tools” version 1.1.1 that are included in this disk are compatible with the “Shared Library Manager” version 1.1.2.
MacSNMP PROGRAMMER'S GUIDE ERRATA
====================================
The Local API doesn't behave as documented in the MacSNMP Programmer's guide. The routine GetVariableInfo doesn't return snmpBadID at the end of MIB or when a given OID is not registered. Instead the field netxMIBlet set to NULL after the last valid OID.
BUG FIXES
=========
• DrWatson and DrWatsonTool
The get-all command over UDP would go into an infinite loop at end of MIB.
Fixed several bugs caused by non-initialized pointers or too small buffers.
Increase the performance of the MPW tool version in term of number of SNMP packets porcessed by seconds.
• SNMPAgentTool
Fix a bug that would create a second ghost agent instance when adding an agent for which its library has been dropped in the Extensions folder after and the class has the preload flag set. Now the SNMPAgentTool calls LoadClass/UnloadClass to create the preload class -- if any -- and if there's still no agent then calls NewObject. The benefit of this fix is that it is now possible to load and unload an agent then trash the library without rebooting.
Using the SNMPAgentTool
=======================
The SNMPAgentTool is a stand-alone application that allows you to load and unload SNMP agents. To use the tool, follow these steps:
1. Launch the SNMPAgentTool. A window will appear containing the following text:
Function desired ( A[ddAgent], R[emoveAgent], L[istAgents] or Q[uit] ):
2. To add an agent type 'a' or "addagent" (not case sensitive) and press Return. The following line will appear:
Agent Class desired :
3. Type the name of the agent's class. For the sample agent, the class is TSampleSNMPAgent. (Note: The class name is case sensitive.) The following response will appear:
### Agent is not present.
### Creating "snmp:agt$TSampleSNMPAgent".
### Agent pointer is 0008F314
(Note: The pointer value will vary.)
4. To remove an agent type 'r' or "removeagent" and press Return. The following line will appear:
Agent Class desired :
5. Type the name of the agent's class. If you type "TSampleSNMPAgent", the following response will appear:
### Found agent "snmp:agt$TSampleSNMPAgent".
### Agent "snmp:agt$TSampleSNMPAgent" has been removed.
Other tools and libraries
======================
1. DrWatson and DrWatsonTool: a SIOW application and its equivalent MPW Tool that allow to query SNMP agents over the network.
2. SNMP TCP/IP Transport: allows MacSNMP to work with MacTCP. You need to place this in your Extensions folder to use SNMP over the TCP/IP network.
DISK CONTENTS
==============
Note: Entries enclosed between two ‘:’ indicate folders.
MacSNMP Developer:
MacSNMP Developer Read Me # this file in TeachText format